home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ShutDown.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  2.5 KB  |  103 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ShutDown.p
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1987-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ShutDown;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __SHUTDOWN__}
  27. {$SETC __SHUTDOWN__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ShutDownIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __MIXEDMODE__}
  37. {$I MixedMode.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45.  
  46. CONST
  47.     sdOnPowerOff                = 1;                            { call procedure before power off. }
  48.     sdOnRestart                    = 2;                            { call procedure before restart. }
  49.     sdOnUnmount                    = 4;                            { call procedure before unmounting. }
  50.     sdOnDrivers                    = 8;                            { call procedure before closing drivers. }
  51.     sdOnBootVolUnmount            = 16;                            { call procedure before unmounting boot volume and VM volume but after unmounting all other volumes }
  52.     sdRestartOrPower            = 3;                            { call before either power off or restart. }
  53.  
  54.  
  55. TYPE
  56. {$IFC TYPED_FUNCTION_POINTERS}
  57.     ShutDwnProcPtr = PROCEDURE(shutDownStage: INTEGER);
  58. {$ELSEC}
  59.     ShutDwnProcPtr = Register68kProcPtr;
  60. {$ENDC}
  61.  
  62.     ShutDwnUPP = UniversalProcPtr;
  63.  
  64. CONST
  65.     uppShutDwnProcInfo = $00001002;
  66.  
  67. FUNCTION NewShutDwnProc(userRoutine: ShutDwnProcPtr): ShutDwnUPP;
  68.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  69.     INLINE $2E9F;
  70.     {$ENDC}
  71.  
  72. PROCEDURE CallShutDwnProc(shutDownStage: INTEGER; userRoutine: ShutDwnUPP);
  73.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  74.     {To be implemented:  Glue to move parameters into registers.}
  75.     {$ENDC}
  76. PROCEDURE ShutDwnPower;
  77.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  78.     INLINE $3F3C, $0001, $A895;
  79.     {$ENDC}
  80. PROCEDURE ShutDwnStart;
  81.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  82.     INLINE $3F3C, $0002, $A895;
  83.     {$ENDC}
  84. PROCEDURE ShutDwnInstall(shutDownProc: ShutDwnUPP; flags: INTEGER);
  85.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  86.     INLINE $3F3C, $0003, $A895;
  87.     {$ENDC}
  88. PROCEDURE ShutDwnRemove(shutDownProc: ShutDwnUPP);
  89.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  90.     INLINE $3F3C, $0004, $A895;
  91.     {$ENDC}
  92.  
  93. {$ALIGN RESET}
  94. {$POP}
  95.  
  96. {$SETC UsingIncludes := ShutDownIncludes}
  97.  
  98. {$ENDC} {__SHUTDOWN__}
  99.  
  100. {$IFC NOT UsingIncludes}
  101.  END.
  102. {$ENDC}
  103.